$(document).ready(function () {
  var liArr = $('.fish-left-nav').children('li');
  var iArr = liArr.children('i');
  var innerArr = $('.fish-left-nav li ul');
  var innerLiArr = innerArr.children('li');
  console.log(liArr,innerArr);
  for (var i = 0; i < liArr.length; i++) {
    (function (index) {
      liArr[i].onclick = function (e) {
        for (var k = 0; k < liArr.length; k++) {
          iArr.eq(k).removeClass('icon-shangjianhao').addClass('icon-xiajianhao')
        }
        var hasActive = innerArr.eq(index)[0].style.display;
        if(hasActive == 'block') {
          innerArr.slideUp(300);
        }else {
          iArr.eq(index).removeClass('icon-xiajianhao').addClass('icon-shangjianhao')
          innerArr.slideUp(300);
          innerArr.eq(index).slideDown(300);
        }
      }
    })(i);
  }
  for (var i = 0; i < innerLiArr.length; i++) {
    innerLiArr[i].onclick = function (e) {
      e.stopPropagation();
      innerLiArr.removeClass('active');
      $(this).addClass('active');
      return false;
    }
  }
});
